package _2025_3_30;

import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

public class demo2 {
    public static void main(String[] args) {
        AtomicInteger atomicInteger=new AtomicInteger();
        // i++
        atomicInteger.getAndIncrement();
        System.out.println(atomicInteger.get());
        // ++i
        System.out.println(atomicInteger.incrementAndGet());
        // i--
        atomicInteger.getAndDecrement();
        System.out.println(atomicInteger.get());
        // --i
        System.out.println(atomicInteger.decrementAndGet());
        //自定义值
        atomicInteger.getAndAdd(50);
        System.out.println(atomicInteger.get());

        //唯一标识
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
        System.out.println(UUID.randomUUID());
    }
}
